// BusinessException.java - 通用业务异常
package com.itheima.exception;

import com.itheima.pojo.Clazz;
import lombok.Getter;

public class ClazzException extends RuntimeException {
    // getter和setter方法
    @Getter
    private int code; // 错误码
    private String message; // 错误信息

    public ClazzException(String message) {
        super(message);
        this.message = message;
    }

    public ClazzException(int code, String message) {
        super(message);
        this.code = code;
        this.message = message;
    }

    public ClazzException(int code, String message, Throwable cause) {
        super(message, cause);
        this.code = code;
        this.message = message;
    }

    public void setCode(int code) {
        this.code = code;
    }

    @Override
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
